home *** CD-ROM | disk | FTP | other *** search
- package javax.swing;
-
- import java.util.Hashtable;
-
- final class AppContext {
- private static Hashtable security2appContexts = null;
- private static Object nullSecurityContext = new Object();
- private static AppContext systemAppContext;
- private final Hashtable table = new Hashtable(2);
- private static Object lastKey;
- private static Object lastValue;
-
- static {
- systemAppContext = new AppContext(nullSecurityContext);
- }
-
- private AppContext(Object var1) {
- if (var1 != nullSecurityContext) {
- if (security2appContexts == null) {
- security2appContexts = new Hashtable(2, 0.2F);
- }
-
- security2appContexts.put(var1, this);
- }
-
- }
-
- public synchronized Object get(Object var1) {
- if (var1 != lastKey || lastValue == null) {
- lastValue = this.table.get(var1);
- lastKey = var1;
- }
-
- return lastValue;
- }
-
- public static AppContext getAppContext() {
- Object var0 = nullSecurityContext;
- if (var0 == nullSecurityContext) {
- return systemAppContext;
- } else {
- AppContext var1 = (AppContext)security2appContexts.get(var0);
- if (var1 == null) {
- var1 = new AppContext(var0);
- security2appContexts.put(var0, var1);
- }
-
- return var1;
- }
- }
-
- public synchronized Object put(Object var1, Object var2) {
- return this.table.put(var1, var2);
- }
-
- public synchronized Object remove(Object var1) {
- return this.table.remove(var1);
- }
-
- public String toString() {
- Object var1 = nullSecurityContext;
- SecurityManager var2 = System.getSecurityManager();
- if (var2 != null) {
- Object var3 = System.getSecurityManager().getSecurityContext();
- if (var3 != null) {
- var1 = var3;
- }
- }
-
- String var4 = var1.equals(nullSecurityContext) ? "null" : var1.toString();
- return this.getClass().getName() + "[SecurityContext=" + var4 + "]";
- }
- }
-